﻿<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商品列表</title>
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <link rel="stylesheet" type="text/css" href="css/home.css" />
    <link rel="stylesheet" type="text/css" href="city/city.css">
    <link rel="icon" href="http://wb.boqibao.com/favicon2.ico">
    <script type="text/javascript" src="script/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="script/home_ban.js"></script>
    <script type="text/javascript" src="script/eg_top_search.js"></script>
    <script type="text/javascript" src="script/city.js"></script>
    <script type="text/javascript" src="script/snncar.js"></script>
    <script type="text/javascript" src="script/math/math.js"></script>

    <!-- 引入Element-UI样式 -->
    <link rel="stylesheet" href="plugins/element/index.css">
    <link rel="stylesheet" href="plugins/element/icon.css" />
    <!--引入vue和Axios.js 先导入vue  再导入axios -->
    <script src="plugins/vue/dist/vue.js"></script>
    <script src="plugins/axios/dist/axios.js"></script>
    <script src="script/main.js"></script>


    <script src="script/bigNumber.js"></script>

    <!-- 引入Element-UI组件库 -->
    <script src="plugins/element/index.js"></script>


    <script type="text/javascript">
        $(function () {
            $('.navmenu li').hover(function () {
                $('span', this).stop().css('height', '2px');
                $('span', this).animate({
                    left: '0',
                    width: '100%',
                    right: '0'
                }, 200);
            }, function () {
                $('span', this).stop().animate({
                    left: '50%',
                    width: '0'
                }, 200);
            });
        });
    </script>

    <!--导航登陆网页版下拉-->
    <script type="text/javascript">
        $(function () {
            var setTime;
            $(".egc-top .nav-cent .operate").hover(function () {
                var _this = $(this);
                setTime = setTimeout(function () {
                    _this.find(".sec-version").slideDown(200);
                    _this.find("i").removeClass("icon-angle-down").addClass("icon-angle-up");
                }, 200);
            }, function () {
                if (setTime) {
                    clearTimeout(setTime);
                }
                $(".egc-top .nav-cent .sec-version").slideUp(200);
                $(".egc-top .nav-cent .operate i").removeClass("icon-angle-up").addClass("icon-angle-down");
            });
        });
    </script>

    <!--底部信息下拉-->
    <script type="text/javascript">
        $(function () {
            var wind_wd = $(window).width();
            if (wind_wd <= 735) {
                /* $submenu.first().delay(400).slideDown(700);*/
                $('.relate .tit').on('click', function () {
                    $(this).next('.con').slideToggle()
                    $(this).parent().siblings('.items').find('.con').slideUp();
                });
            } else {
                $('.relate .tit').unbind("click");
                $('.relate .con').show();
            }
            $(window).resize(function () {
                var wind_wd = $(window).width();
                if (wind_wd <= 735) {
                    /* $submenu.first().delay(400).slideDown(700);*/
                    $('.relate .tit').on('click', function () {
                        $(this).next('.con').slideToggle()
                        $(this).parent().siblings('.items').find('.con').slideUp();
                    });
                } else {
                    $('.relate .tit').unbind("click");
                    $('.relate .con').show();
                }
            });
        });
    </script>

    <!--搜搜框获取焦点-->
    <script type="text/javascript">
        $(function () {
            $('.sea-ipt-txt').focus(function () {
                $(this).addClass("on");
                $('.search-btn').addClass("on");
            });
            $('.sea-ipt-txt').blur(function () {
                $(this).removeClass("on");
                $('.search-btn').removeClass("on");
            });
        });
    </script>

    <!--下拉导航关闭-->
    <script type="text/javascript">
        $(function () {
            $('.menu-mb i').click(function () {
                $(".navigation-mb-list").slideDown(300);
            });
            $('.navigation-mb-list .list-close-btn').click(function () {
                $(".navigation-mb-list").slideUp(300);
            });
        });
    </script>

    <!--stress搜索关闭-->
    <script type="text/javascript">
        $(function () {
            var setTime;
            $(".sercat .weixin").hover(function () {
                setTime = setTimeout(function () {
                    $(".sercat .wxewm").show();
                }, 300);
            }, function () {
                if (setTime) {
                    clearTimeout(setTime);
                }
                $(".sercat .wxewm").hide();
            });
        });
    </script>

    <script type="text/javascript">
        $(function () {
            var scroll_heitht = $('body').offset().top;
            var isShow = true;
            $(window).scroll(function () {
                if ($(window).scrollTop() > scroll_heitht && isShow) {
                    $('.stress-search-box').slideDown(200);
                } else {
                    $('.stress-search-box').slideUp(200);
                }
            });
            $('.stress-close a').click(function () {
                isShow = false;
                $('.stress-search-box').slideUp(200).unbind(window, aa);
            });
        });
    </script>

</head>

<body>
    <div id="goodsSearch">
        <div class="egc-top">
            <div class="nav-cent">
                <div class="top-r">
                    <span>
                        <a href="" class="top-l" id="myBtn1" @click="recharge">充值联系方式</a>|
                    </span>
                    <!--                <span>-->
                    <!--                    <a href="contactCustomer.html" class="top-l" @click="">联系客服</a>|-->
                    <!--                </span>-->
                    <span id="loginBefore">
                        <!--                    <a href="javascript:void(0)" id="b-regist">注册</a>|-->
                        <a href="#" id="b-login" class="b-login">登陆</a>
                    </span>
                    <span id="loginAfter" style="display: none;">
                        欢迎您：{{username}}！| 余额:{{this.user.balance}} |
                        <a href="#" id="b-logout" @click="loginOut">登出</a>
                        <!--                    <a href="/user_client/orderInfo.html">购物车<span id="carCountSpan" class="number"-->
                        <!--                                                            style="margin-left: 10px;">({{carCount}})</span></a>-->
                    </span>
                </div>
                <!--            <div class="top-l">全国统一客服热线：XXX</div>-->
                <div class="clear_fix"></div>
            </div>
        </div>

        <div class="navigation">
            <div class="nav-cent">
                <div class="logo"><a href="index.html"><img src="images/logo.png.jpg"
                            style="width: 145px; height: 90px" /></a></div>
                <div class="sea">
                    <div class="egc-sea-box">
                        <input type="text" class="sea-ipt-txt" v-model="query.keyword" placeholder="搜索您想要的商品" />
                        <a href="#" class="search-btn" @click="search">搜索</a>
                    </div>
                </div>
                <div class="hot-phone"><i></i> <span class="js-change-phone"></span></div>
            </div>
        </div>

        <ul class="navmenu">
            <li><a href="index.html">首页</a><span></span></li>
            <li class="active"><a href="goods.html">商品列表</a><span></span></li>
            <li><a href="order.html">订单中心</a><span></span></li>
            <!--        <li><a href="bill.html">订单-&#45;&#45;明细</a><span></span></li>-->
            <!--        <li><a href="user.html">个人中心</a><span></span></li>-->
        </ul>
        <div class="clear_fix"></div>

        <div class="clear_fix"></div>
        <!--所在位置-->
        <div class="crumbp">
            <a href="index.html">首页</a>
            <em>&gt;</em> <span>商品列表</span>
        </div>

        <div class="mainbox">
            <!--搜索条件-->
            <div class="comfilter-bd">
                <div class="filterBox">
                    <dl class="fliter-bd clearfix">
                        <dt>类别：</dt>
                        <dd class="clickBrandWidget">
                            <a :class="{'on': this.query.type == null}" href="goods.html"> 不限 </a>
                            <a :class="{'on': this.query.type == 1}" href="#" title="关注" @click="searchByBrand(1)">
                                关注 </a>
                            <a :class="{'on': this.query.type == 2}" href="#" title="转发" @click="searchByBrand(2)">
                                转发 </a>
                            <a :class="{'on': this.query.type == 3}" href="#" title="评论" @click="searchByBrand(3)">
                                评论 </a>
                            <a :class="{'on': this.query.type == 4}" href="#" title="点赞" @click="searchByBrand(4)">
                                点赞 </a>
                            <a :class="{'on': this.query.type == 5}" href="#" title="阅读" @click="searchByBrand(5)">
                                阅读 </a>
                            <a :class="{'on': this.query.type == 6}" href="#" title="视频播放" @click="searchByBrand(6)">
                                视频播放 </a>
                            <a :class="{'on': this.query.type == 7}" href="#" title="真人转评赞" @click="searchByBrand(7)">
                                真人转评赞 </a>
                            <a :class="{'on': this.query.type == 8}" href="#" title="统一转评赞" @click="searchByBrand(8)">
                                统一转评赞 </a>
                            <a :class="{'on': this.query.type == 9}" href="#" title="评中评" @click="searchByBrand(9)">
                                评中评 </a>
                            <a :class="{'on': this.query.type == 10}" href="#" title="评论赞" @click="searchByBrand(10)">
                                评论赞 </a>

                            <!--品牌全部-->
                        </dd>
                    </dl>
                </div>
            </div>

            <!-- 商品展示列表 -->
            <ul class="carList">
                <li v-for="goods in pageInfo.rows">
                    <div class="list-infoBox" @click="goodClick(goods)">
                        <a :title="goods.name" target="_blank" class="imgtype">
                            <!--                        :href="`user_client/${goods.id}.html`"-->

                            <img :src="goods.goodsImg" :alt="goods.name" width="290" height="194" />
                        </a>
                        <p class="infoBox">
                            <a :title="goods.name" target="_blank" class="info-title">
                                {{goods.name}} &emsp;|
                            </a>
                            <span class=""> &emsp;描述：{{goods.description}}</span>
                        </p>
                        <p class="fc-gray">
                        </p>
                        <p class="priType-s">
                            <span>
                                <i class="fc-org priType" v-show="goods.type!=8"> ¥&nbsp;{{goods.price}} </i>
                                <i class="infoBox">&emsp;店铺：{{goods.shop.name}}</i>
                            </span>
                        </p>
                    </div>
                </li>
            </ul>

        </div>

        <div class="pages">
            <span v-for="page in pageInfo.totalPage">
                <a v-if="page == query.currentPage" class="on" @click="changePageCount(page)">{{page}}</a>
                <a v-else href="30/p/1.html" @click="changePageCount(page)">{{page}}</a>
            </span>
        </div>

        <div class="clear_fix"></div>

        <script type="text/javascript" src="script/3c-menu.js"></script>
        <script type="text/javascript" src="script/lg_reg.js"></script>

        <!--会员登录和注册弹出框开始-->
        <!--    <div id="popBox">-->
        <!--        <div class="popCont"><a class="p_closed">关闭</a>-->
        <!--            <div class="p-tab">-->
        <!--                <a class="login">会员登录<i></i></a>-->
        <!--                <a class="regist">会员注册<i></i></a>-->
        <!--            </div>-->
        <!--            <div class="p-detail">-->
        <!--                <div class="p-dl login">-->
        <!--                    <form onsubmit="return check();" enctype="multipart/form-data" method="post" name="form" id="form">-->
        <!--                        <ul class="login-items">-->
        <!--                            <li>-->
        <!--                                <label>用户名</label>-->
        <!--                                <input class="input" type="text" value="" maxlength="32" name="username"-->
        <!--                                       v-model="loginDto.username"-->
        <!--                                       placeholder="请输入用户名(账号/手机号/邮箱)">-->
        <!--                            </li>-->
        <!--                            <li>-->
        <!--                                <label>密码</label>-->
        <!--                                <input class="input" type="password" value="" maxlength="16" name="password"-->
        <!--                                       v-model="loginDto.password" placeholder="请输入密码">-->
        <!--                            </li>-->
        <!--                        </ul>-->
        <!--                        <div class="login-check">-->
        <!--                            <input type="checkbox" name="checkbox" style=" width:auto;"/>-->
        <!--                            <label>记住我</label>-->
        <!--                            <a href="Meet/editPass">忘记登录密码？</a></div>-->
        <!--                        <div class="login-button">-->
        <!--                            <input type="hidden" value="" name="carid" class="ordercarid"/>-->
        <!--                            <input type="hidden" value="" name="carstatus" class="orderstatus"/>-->
        <!--                            <input type="button" value="登陆" class="fM" @click="loginIn"/>-->
        <!--                        </div>-->
        <!--                    </form>-->
        <!--                </div>-->

        <!--                <div class="p-dl regist">-->
        <!--                    <form class="registForm" onsubmit="return regcheck();" enctype="multipart/form-data" method="post"-->
        <!--                          name="reg" id="reg">-->
        <!--                        <ul class="login-items">-->
        <!--                            <li class="clearfix">-->
        <!--                                <input class="input" name="mobile" id="phone" :maxlength="11"-->
        <!--                                       v-model="RegisterDTO.phone" type="text" value=""-->
        <!--                                       placeholder="手机号">-->
        <!--                            </li>-->
        <!--                            <li class="clearfix">-->
        <!--                                <input class="input" type="text" v-model="RegisterDTO.username" value="" name="realname"-->
        <!--                                       placeholder="用户名">-->
        <!--                            </li>-->
        <!--                            <li class="clearfix">-->
        <!--                                <input class="input" type="text" value="" v-model="RegisterDTO.email" name="email"-->
        <!--                                       placeholder="邮箱">-->
        <!--                            </li>-->
        <!--                            <li class="clearfix">-->
        <!--                                <input id="" class="input" type="password" v-model="RegisterDTO.password"-->
        <!--                                       name="password" value=""-->
        <!--                                       placeholder="密码">-->
        <!--                            </li>-->
        <!--                            <li class="clearfix">-->
        <!--                                <input class="input" type="password" v-model="RegisterDTO.confirmPassword"-->
        <!--                                       name="confirmPassword" value=""-->
        <!--                                       placeholder="确认密码">-->
        <!--                            </li>-->
        <!--                        </ul>-->
        <!--                        <div class="login-button">-->
        <!--                            <input type="hidden" value="" name="carid" class="ordercarid"/>-->
        <!--                            <input type="hidden" value="" name="carstatus" class="orderstatus"/>-->
        <!--                            <input type="button" value="立即注册" class="fM" @click="registerSave"/>-->
        <!--                        </div>-->
        <!--                    </form>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--        </div>-->
        <!--    </div>-->

        <!--会员登录和注册弹出框结束-->
        <!--    <script>-->
        <!--        $(function () {-->
        <!--            var t = null, $this, i = 0;-->
        <!--            //品牌-->
        <!--            $(".brand-all").bind({-->
        <!--                mouseenter: function () {-->
        <!--                    $(this).find(".otherbrand").show();-->
        <!--                },-->
        <!--                mouseleave: function () {-->
        <!--                    $(this).find(".otherbrand").hide();-->
        <!--                }-->
        <!--            });-->

        <!--        });-->
        <!--    </script>-->
        <!--    <script type="text/javascript">-->
        <!--        $(".hoverWidget").each(function () {-->
        <!--            $(this).mouseenter(function () {-->
        <!--                $(this).addClass("active")-->
        <!--            }).mouseleave(function () {-->
        <!--                $(this).removeClass("active")-->
        <!--            })-->
        <!--        });-->
        <!--    </script>-->


        <div>
            <el-dialog title="商品详情" :visible.sync="showOutOrDialog" :before-close="handleClose">

                <el-dialog width="30%" center="true" title="确认订单" :visible.sync="showInOrDialog" append-to-body>
                    <div v-loading.fullscreen.lock="fullscreenLoading">>
                        本次订单共计花费：
                        <div style="font-size: medium;margin-top: 10px;color: red">
                            钻石:{{this.getFinalPriceByDifTab()}}
                        </div>

                    </div>

                    <div slot="footer" class="dialog-footer">
                        <el-button @click="showInOrDialog = false">取 消</el-button>
                        <el-button type="primary" @click="clickAddOrder">确 认</el-button>
                    </div>


                </el-dialog>
                <div v-show="goodRow.type<8">
                    <el-tabs v-model="activeName" @tab-click="handleClick">
                        <el-tab-pane label="单个订单" name="first">
                            <el-row>
                                <el-card :body-style="{ padding: '10px' }">

                                    <el-row justify="center">
                                        <el-col :span="14">
                                            <div style="padding: 14px;">
                                                <el-descriptions title="详细" direction="vertical">
                                                    <el-descriptions-item label="商品名">{{goodRow.name}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="描述">{{goodRow.description}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="价格">{{goodRow.price}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="备注">
                                                        <el-tag
                                                            size="middle">{{getTypeByTypeNum(goodRow.type)}}</el-tag>
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="店铺">{{goodRow.shop.name}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="购买数量">{{finalPay.orderCount}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="最大下单数量">{{goodRow.maxqty}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="最小下单数量">{{goodRow.minqty}}
                                                    </el-descriptions-item>
                                                </el-descriptions>
                                            </div>

                                            <div style="overflow: auto">
                                                <div style="padding: 10px">
                                                    <el-input style="width: 600px" type="url" placeholder="请输入需要操作的微博链接"
                                                        v-model="finalPay.wbUrl">
                                                    </el-input>
                                                    <div style="margin-top: 20px">
                                                        <el-input-number size="medium" v-model="finalPay.orderCount"
                                                            @change="handleChange" :step="goodRow.minqty"
                                                            :min="goodRow.minqty"
                                                            :max="goodRow.maxqty"></el-input-number>
                                                    </div>
                                                </div>
                                                <el-row>
                                                    <!--                                        500 1000 5000 10000-->
                                                    <el-col :span="3">
                                                        <el-button @click="handleChange(500)" size="mini" type="warning"
                                                            plain>500
                                                        </el-button>
                                                    </el-col>
                                                    <el-col :span="4">
                                                        <el-button @click="handleChange(1000)" size="mini"
                                                            type="warning" plain>1000
                                                        </el-button>
                                                    </el-col>
                                                    <el-col :span="4">
                                                        <el-button @click="handleChange(5000)" size="mini"
                                                            type="warning" plain>5000
                                                        </el-button>
                                                    </el-col>
                                                    <el-col :span="4">
                                                        <el-button @click="handleChange(10000)" size="mini"
                                                            type="warning" plain>10000
                                                        </el-button>
                                                    </el-col>
                                                    <el-col :span="4">
                                                        <el-button @click="handleChange(goodRow.maxqty)" size="mini"
                                                            type="warning" plain>
                                                            最大
                                                        </el-button>
                                                    </el-col>
                                                </el-row>
                                                <div style="margin-top: 30px">
                                                    <el-descriptions direction="horizontal">

                                                        <el-descriptions-item label="价格">
                                                            <el-tag size="bigs">{{finalPay.payPrice}}</el-tag>
                                                        </el-descriptions-item>
                                                    </el-descriptions>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>

                                    <div>
                                        <el-button @click="quitDialog">取 消</el-button>
                                        <el-button type="primary" @click="outOrderCheck">下 单</el-button>
                                    </div>
                                </el-card>
                            </el-row>
                        </el-tab-pane>

                        <!--            这边开始多个订单  -->
                        <el-tab-pane label="多个订单" name="second">
                            <el-row>
                                <el-card :body-style="{ padding: '10px' }">

                                    <el-row justify="center">
                                        <!--                            <el-col :span="10">-->
                                        <!--                                <img :src="goodRow.goodsImg" class="image">-->
                                        <!--                            </el-col>-->
                                        <el-col :span="14">
                                            <div style="padding: 14px;">
                                                <el-descriptions title="详细" direction="vertical">
                                                    <el-descriptions-item label="商品名">{{goodRow.name}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="描述">{{goodRow.description}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="价格">{{goodRow.price}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="备注">
                                                        <el-tag
                                                            size="middle">{{getTypeByTypeNum(goodRow.type)}}</el-tag>
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="店铺">{{goodRow.shop.name}}
                                                    </el-descriptions-item>
                                                    <!--                                        <el-descriptions-item label="购买数量">{{finalPay.orderCount}}-->
                                                    <!--                                        </el-descriptions-item>-->
                                                    <el-descriptions-item label="最大下单数量">{{goodRow.maxqty}}
                                                    </el-descriptions-item>
                                                    <el-descriptions-item label="最小下单数量">{{goodRow.minqty}}
                                                    </el-descriptions-item>
                                                </el-descriptions>
                                            </div>

                                            <div style="padding: 10px;">
                                                <el-tag type="danger">请正确输入格式(微博链接URL
                                                    数量)-多个订单以回车分割,如检测不到数量则使用默认数量
                                                </el-tag>
                                            </div>
                                            <div style="padding: 10px">
                                                <el-tag type="danger">举例如下:</el-tag>
                                            </div>

                                            <div style="overflow: auto">
                                                <div style="padding: 10px;overflow: auto ">
                                                    <el-input style="width: 600px;overflow: auto" type="textarea"
                                                        :rows="8" placeholder="https://weibo.com/3587960280/4875171297233894  200
                                                          https://weibo.com/3587960280/4875171297233894  100
                                                          https://weibo.com/3587960280/4875171297233894  500
                                                          https://weibo.com/3587960280/4875171297233894  100"
                                                        v-model="finalPay.wbUrl" @blur="updateWbUrl">
                                                    </el-input>
                                                    <div style="margin-top: 20px">
                                                        <el-input-number size="medium" v-model="finalPay.orderCount"
                                                            @change="handleChange" :step="goodRow.minqty"
                                                            :min="goodRow.minqty"
                                                            :max="goodRow.maxqty"></el-input-number>
                                                    </div>
                                                </div>

                                                <div style="margin-top: 30px">
                                                    <el-descriptions direction="horizontal">

                                                        <el-descriptions-item label="价格">
                                                            <el-tag
                                                                size="bigs">{{this.getFinalPriceByDifTab()}}</el-tag>
                                                        </el-descriptions-item>
                                                    </el-descriptions>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>
                                    <div>
                                        <el-button @click="showOutOrDialog = false">取 消</el-button>
                                        <el-button type="primary" @click="outOrderCheck">下 单</el-button>
                                    </div>
                                </el-card>
                            </el-row>

                        </el-tab-pane>

                    </el-tabs>
                </div>

                <div v-show="goodRow.type==10">
                    <el-row>
                        <el-card :body-style="{ padding: '10px' }">

                            <el-row justify="center">
                                <el-col :span="14">
                                    <div style="padding: 14px;">
                                        <el-descriptions title="详细" direction="vertical">
                                            <el-descriptions-item label="商品名">{{goodRow.name}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="描述">{{goodRow.description}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="价格">{{goodRow.price}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="备注">
                                                <el-tag size="middle">{{getTypeByTypeNum(goodRow.type)}}</el-tag>
                                            </el-descriptions-item>
                                            <el-descriptions-item label="店铺">{{goodRow.shop.name}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="购买数量">{{finalPay.orderCount}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="最大下单数量">{{goodRow.maxqty}}
                                            </el-descriptions-item>
                                            <el-descriptions-item label="最小下单数量">{{goodRow.minqty}}
                                            </el-descriptions-item>
                                        </el-descriptions>
                                    </div>

                                    <div style="overflow: auto;width: 500px">
                                        <div style="padding: 10px;width: 1000px">
                                            <div style="padding: 10px;width: 1000px">
                                                <!--                                            <el-tag type="danger" v-show="goodRow.type==9">请正确输入格式(微博链接URL-&#45;&#45;uid-&#45;&#45;数量)-多个订单以回车分割,如检测不到数量则使用默认数量-->
                                                <!--                                            </el-tag>-->
                                                <el-tag type="danger" v-show="goodRow.type==10">请正确输入格式(
                                                    taskId----数量)-多个订单以回车分割,如检测不到数量则使用默认数量
                                                </el-tag>
                                            </div>
                                            <div style="padding: 10px">
                                                <el-tag type="danger">举例如下:</el-tag>
                                            </div>

                                            <div style="overflow: auto" style="width: 1200px">
                                                <div style="padding: 10px;overflow: auto ">
                                                    <!--                                                <el-input style="width: 1000px;overflow: auto" type="textarea"-->
                                                    <!--                                                          :rows="8"-->
                                                    <!--                                                          placeholder="https://weibo.com/4875171297233894-&#45;&#45;7777777777-&#45;&#45;100-->
                                                    <!--https://weibo.com/4875171297233894-&#45;&#45;1111111111-&#45;&#45;500-->
                                                    <!--https://weibo.com/4875171297233894-&#45;&#45;2222222222-&#45;&#45;100"-->
                                                    <!--                                                          v-model="finalPay.wbUrl"-->
                                                    <!--                                                          v-show="goodRow.type==9">-->
                                                    <!--                                                </el-input>-->
                                                    <el-input style="width: 800px;overflow: auto" type="textarea"
                                                        :rows="8" placeholder="5057908052328538----100
5057908052328538----500" v-model="finalPay.wbUrl" v-show="goodRow.type==10" @blur="updateWbUrlByTen">
                                                    </el-input>
                                                    <div style="margin-top: 20px">
                                                        <el-input-number size="medium" v-model="finalPay.orderCount"
                                                            @change="handleChange" :step="goodRow.minqty"
                                                            :min="goodRow.minqty"
                                                            :max="goodRow.maxqty"></el-input-number>
                                                    </div>
                                                </div>
                                            </div>
                                            <el-row>
                                                <!--                                        500 1000 5000 10000-->
                                                <el-col :span="2">
                                                    <el-button @click="handleChange(500)" size="mini" type="warning"
                                                        plain>500
                                                    </el-button>
                                                </el-col>
                                                <el-col :span="2">
                                                    <el-button @click="handleChange(1000)" size="mini" type="warning"
                                                        plain>1000
                                                    </el-button>
                                                </el-col>
                                                <el-col :span="2">
                                                    <el-button @click="handleChange(5000)" size="mini" type="warning"
                                                        plain>5000
                                                    </el-button>
                                                </el-col>
                                                <el-col :span="2">
                                                    <el-button @click="handleChange(10000)" size="mini" type="warning"
                                                        plain>10000
                                                    </el-button>
                                                </el-col>
                                                <el-col :span="2">
                                                    <el-button @click="handleChange(goodRow.maxqty)" size="mini"
                                                        type="warning" plain>
                                                        最大
                                                    </el-button>
                                                </el-col>
                                            </el-row>
                                            <!--                                    <div style="margin-top: 30px">-->
                                            <!--                                        <el-descriptions direction="horizontal">-->

                                            <!--                                            <el-descriptions-item label="价格">-->
                                            <!--                                                <el-tag size="bigs">{{finalPay.payPrice}}</el-tag>-->
                                            <!--                                            </el-descriptions-item>-->
                                            <!--                                        </el-descriptions>-->
                                            <!--                                    </div>-->
                                        </div>
                                    </div>
                                </el-col>
                            </el-row>

                            <div>
                                <el-button @click="quitDialog">取 消</el-button>
                                <el-button type="primary" @click="outOrderCheck">下 单</el-button>
                            </div>
                        </el-card>
                    </el-row>
                </div>
            </el-dialog>
        </div>

        <div>
            <el-dialog title="商品详情" :visible.sync="showUnitDialog" :before-close="handleClose">


                <el-dialog width="30%" center="true" title="确认订单" :visible.sync="showUnitInDialog" append-to-body>
                    <div v-loading.fullscreen.lock="fullscreenLoading">>
                        本次订单共计花费：
                        <div style="font-size: medium;margin-top: 10px;color: red">
                            钻石:{{this.getUniFinalPrice()}}
                        </div>
                    </div>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="showUnitInDialog = false">取 消</el-button>
                        <el-button type="primary" @click="clickAddUniOrder">确 认</el-button>
                    </div>
                </el-dialog>

                <el-row>
                    <el-card :body-style="{ padding: '10px' }">

                        <el-row justify="center">
                            <el-col :span="14">
                                <div style="padding: 14px;">
                                    <el-descriptions title="详细" direction="vertical">
                                        <el-descriptions-item label="商品名">{{goodRow.name}}</el-descriptions-item>
                                        <el-descriptions-item label="描述">{{goodRow.description}}</el-descriptions-item>
                                        <el-descriptions-item label="店铺">{{goodRow.shop.name}}</el-descriptions-item>

                                        <el-descriptions-item label="价格(转发)">{{remarks.sFprice}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最大下单数量(转发)">{{remarks.sFmaxqty}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最小下单数量(转发)">{{remarks.sFminqty}}
                                        </el-descriptions-item>


                                        <el-descriptions-item label="价格(评论)">{{remarks.sCprice}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最大下单数量(评论)">{{remarks.sCmaxqty}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最小下单数量(评论)">{{remarks.sCminqty}}
                                        </el-descriptions-item>


                                        <el-descriptions-item label="价格(点赞)">{{remarks.sGprice}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最大下单数量(点赞)">{{remarks.sGmaxqty}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="最小下单数量(点赞)">{{remarks.sGminqty}}
                                        </el-descriptions-item>


                                        <el-descriptions-item label="备注">
                                            <el-tag size="middle">{{getTypeByTypeNum(goodRow.type)}}</el-tag>
                                        </el-descriptions-item>
                                    </el-descriptions>
                                </div>

                                <div style="overflow: auto">
                                    <div style="padding: 10px">
                                        <el-input style="width: 600px" type="url" placeholder="请输入需要操作的微博链接"
                                            v-model="finalPay.wbUrl">
                                        </el-input>
                                    </div>


                                    <div style="margin-top: 20px">
                                        <div>转发</div>
                                        <el-input-number size="medium" v-model="this.uniFinalData.count.countf"
                                            :step="remarks.sFminqty" @change="uniHandleChangef" :min="remarks.sFminqty"
                                            :max="remarks.sFmaxqty"></el-input-number>

                                        <el-row>
                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangef(500)" size="mini" type="warning"
                                                    plain>500
                                                </el-button>
                                            </el-col>


                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangef(1000)" size="mini" type="warning"
                                                    plain>1000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangef(5000)" size="mini" type="warning"
                                                    plain>5000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangef(10000)" size="mini" type="warning"
                                                    plain>10000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangef(remarks.sFmaxqty)" size="mini"
                                                    type="warning" plain>
                                                    最大
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </div>


                                    <div style="margin-top: 20px">
                                        <div>评论</div>
                                        <el-input-number size="medium" v-model="this.uniFinalData.count.countc"
                                            :step="remarks.sCminqty" @change="uniHandleChangec" :min="remarks.sCminqty"
                                            :max="remarks.sCmaxqty"></el-input-number>

                                        <el-row>


                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangec(500)" size="mini" type="warning"
                                                    plain>500
                                                </el-button>
                                            </el-col>


                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangec(1000)" size="mini" type="warning"
                                                    plain>1000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangec(5000)" size="mini" type="warning"
                                                    plain>5000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangec(10000)" size="mini" type="warning"
                                                    plain>10000
                                                </el-button>
                                            </el-col>



                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangec(remarks.sCmaxqty)" size="mini"
                                                    type="warning" plain>
                                                    最大
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </div>


                                    <div style="margin-top: 20px">
                                        <div>点赞</div>
                                        <el-input-number size="medium" v-model="this.uniFinalData.count.countg"
                                            :step="remarks.sGminqty" @change="uniHandleChangeg" :min="remarks.sGminqty"
                                            :max="remarks.sGmaxqty"></el-input-number>

                                        <el-row>
                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangeg(500)" size="mini" type="warning"
                                                    plain>500
                                                </el-button>
                                            </el-col>


                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangeg(1000)" size="mini" type="warning"
                                                    plain>1000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangeg(5000)" size="mini" type="warning"
                                                    plain>5000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangeg(10000)" size="mini" type="warning"
                                                    plain>10000
                                                </el-button>
                                            </el-col>

                                            <el-col :span="4">
                                                <el-button @click="uniHandleChangeg(remarks.sGmaxqty)" size="mini"
                                                    type="warning" plain>
                                                    最大
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </div>
                                    <div style="margin-top: 30px">
                                        <el-descriptions direction="horizontal">

                                            <el-descriptions-item label="价格">
                                                <el-tag size="bigs">{{this.getUniFinalPrice()}}</el-tag>
                                            </el-descriptions-item>
                                        </el-descriptions>
                                    </div>
                                </div>
                            </el-col>
                        </el-row>

                        <div>
                            <el-button @click="quitDialog">取 消</el-button>
                            <el-button type="primary" @click="outOrderCheck">下 单</el-button>
                        </div>
                    </el-card>
                </el-row>


            </el-dialog>
        </div>

    </div>


    <script type="text/javascript">
        $(document).ready(function () {

            $("#leftsead a").hover(function () {
                if ($(this).prop("className") == "youhui") {
                    $(this).children("img.hides").show();
                } else {
                    $(this).children("img.hides").show();
                    $(this).children("img.shows").hide();
                    $(this).children("img.hides").animate({ marginRight: '0px' }, 'slow');
                }
            }, function () {
                if ($(this).prop("className") == "youhui") {
                    $(this).children("img.hides").hide('slow');
                } else {
                    $(this).children("img.hides").animate({ marginRight: '-143px' }, 'slow', function () {
                        $(this).hide();
                        $(this).next("img.shows").show();
                    });
                }
            });

            $("#top_btn").click(function () {
                if (scroll == "off") return;
                $("html,body").animate({ scrollTop: 0 }, 600);
            });

        });
    </script>

    <script type="text/javascript">
        $(function () {
            $(".selecter").each(function () {
                var s = $(this);
                var z = parseInt(s.css("z-index"));
                var dt = $(this).children("dt");
                var dd = $(this).children("dd");
                var _show = function () {
                    dd.slideDown(200);
                    dt.addClass("cur");
                    s.css("z-index", z + 1);
                };   //展开效果
                var _hide = function () {
                    dd.slideUp(200);
                    dt.removeClass("cur");
                    s.css("z-index", z);
                };    //关闭效果
                dt.click(function () {
                    dd.is(":hidden") ? _show() : _hide();
                });
                dd.find("a").click(function () {
                    dt.html($(this).html());
                    _hide();
                });     //选择效果（如需要传值，可自定义参数，在此处返回对应的“value”值 ）
                $("body").click(function (i) {
                    !$(i.target).parents(".selecter").first().is(s) ? _hide() : "";
                });
            })
        })
    </script>

    <script type="text/javascript">
        new Vue({
            el: "#goodsSearch",

            data: {
                visible: false,
                query: {
                    currentPage: 1,
                    pageSize: 24,
                    keyword: "",
                    type: null,
                    minPrice: null,
                    maxPrice: null
                },
                pageInfo: {
                    rows: [],
                    total: 0,
                    totalPage: 0
                },
                min: null,
                max: null,

                img: "",
                imgCodePrefix: "data:image/jpeg;base64,",
                RegisterDTO: {
                    username: "",
                    password: "",
                    confirmPassword: "",
                    phone: "",
                    email: ""
                },

                //登录
                loginDto: {
                    username: '',
                    password: ''
                },
                //用来登录后展示用户名
                username: "",
                userid: "",
                user: {
                    balance: "",
                },
                balance: "",

                showOutOrDialog: false,//外层弹窗
                showInOrDialog: false,//内部确认弹窗
                showUnitDialog: false,//统一转评赞确认弹窗
                showUnitInDialog: false,//统一转评赞内部确认弹窗
                fullscreenLoading: false,//设置等待遮罩
                goodRow: {
                    id: '',//商品id
                    name: '',//商品名称
                    goodsImg: '',//商品图片
                    description: '',//商品描述
                    price: '',//商品售价
                    shopId: '',//店铺id
                    type: 0,//商品类型
                    refundNumber: "",//uid
                    maxqty: 0,
                    minqty: 0,
                    shop: {
                        id: "",
                        name: "",
                        businessId: null,
                        registerTime: null,
                        state: null,
                        manager: null
                    },
                },
                remarks: {
                    sFprice: 0,
                    sFminqty: 0,
                    sFmaxqty: 0,
                    sCprice: 0,
                    sCminqty: 0,
                    sCmaxqty: 0,
                    sGprice: 0,
                    sGminqty: 0,
                    sGmaxqty: 0
                },
                finalPay: {
                    orderCount: 100,
                    payPrice: 0,
                    wbUrl: "",
                    // commentText: "",
                    // weiboUsername: ""
                },
                activeName: 'first',
                uniFinalData: {
                    count: {
                        countf: 0,
                        countc: 0,
                        countg: 0,
                    },
                    price: {
                        pricef: 0,
                        pricec: 0,
                        priceg: 0
                    }
                }
            },

            methods: {


                getUniFinalPrice() {
                    this.uniFinalData.price.pricef = this.getTimes(this.remarks.sFprice, this.uniFinalData.count.countf);
                    this.uniFinalData.price.pricec = this.getTimes(this.remarks.sCprice, this.uniFinalData.count.countc);
                    this.uniFinalData.price.priceg = this.getTimes(this.remarks.sGprice, this.uniFinalData.count.countg);

                    const total = math.add(
                        math.bignumber(this.uniFinalData.price.pricef),
                        math.bignumber(this.uniFinalData.price.pricec),
                        math.bignumber(this.uniFinalData.price.priceg)
                    );


                    return parseFloat(total.toString());
                },


                quitDialog() {
                    this.finalPay.wbUrl = ''

                    this.showOutOrDialog = false
                    this.showUnitDialog = false
                },


                handleClose(done) {

                    this.$confirm('确认关闭？')
                        .then(_ => {

                            this.finalPay.wbUrl = ''
                            done();
                        })
                        .catch(_ => {
                        });

                },

                handleChange(value) {

                    console.log(value)

                    if (value < this.goodRow.minqty || value > this.goodRow.maxqty) {

                        this.$message({
                            message: '不在规定下单数范围内',
                            type: 'warning'
                        });

                        return;
                    }


                    this.finalPay.orderCount = value
                    this.finalPay.payPrice = this.getTimes(this.goodRow.price, this.finalPay.orderCount)


                    let type = "second"
                    let webUrl = this.finalPay.wbUrl
                    if (this.goodRow.type == 10) {
                        let updatedWbUrl = '';
                        const lines = this.finalPay.wbUrl.split('\n');
                        const validLines = lines.filter(item => item.trim() !== '');

                        for (let i = 0; i < validLines.length; i++) {
                            const parts = validLines[i].split('----');
                            if (parts.length !== 2) {
                                console.error('Invalid format:', validLines[i]);
                                continue;
                            }

                            const [refundNumberStr, _] = parts;
                            // 更新count为当前的orderCount
                            const updatedLine = `${refundNumberStr}----${this.finalPay.orderCount}`;
                            updatedWbUrl += `${updatedLine}\n`;
                        }

                        // 移除最后一个多余的换行符
                        this.finalPay.wbUrl = updatedWbUrl.trim();
                    } else if (this.activeName.toLowerCase() === type.toLowerCase() && webUrl != '') {
                        //最后修改的微博url
                        let finalWebUrl = "";

                        const res = webUrl.split("\n")
                        const urls = res.filter(item => item && item.trim() !== '');
                        for (let k = 0; k < urls.length; k++) {

                            // 正则表达式匹配URL
                            const urlPattern = /^https?:\/\/[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+/;
                            const urlMatch = urls[k].match(urlPattern);
                            const extractedUrl = urlMatch ? urlMatch[0] : null;

                            //字符串二次拼接
                            finalWebUrl += `${extractedUrl} ${value}\n`;

                        }

                        this.finalPay.wbUrl = finalWebUrl
                    }

                },


                uniHandleChangef(value) {

                    if (value < this.remarks.sFminqty || value > this.remarks.sFmaxqty) {

                        this.$message({
                            message: '不在规定下单数范围内',
                            type: 'warning'
                        });

                        return;
                    }

                    this.uniFinalData.count.countf = value;
                    this.getUniFinalPrice();
                },
                uniHandleChangec(value) {
                    if (value < this.remarks.sCminqty || value > this.remarks.sCmaxqty) {

                        this.$message({
                            message: '不在规定下单数范围内',
                            type: 'warning'
                        });

                        return;
                    }
                    this.uniFinalData.count.countc = value;
                    this.getUniFinalPrice();

                },
                uniHandleChangeg(value) {
                    if (value < this.remarks.sGminqty || value > this.remarks.sGmaxqty) {

                        this.$message({
                            message: '不在规定下单数范围内',
                            type: 'warning'
                        });

                        return;
                    }
                    this.uniFinalData.count.countg = value;
                    this.getUniFinalPrice();
                },


                recharge() {
                    alert("请联系QQ:3688032004;QQ:2717196271")
                },


                // 输入框失去焦点事件
                updateWbUrl(e) {
                    let webUrl = e.target.value
                    //最后修改的微博url
                    let finalWebUrl = "";

                    const res = webUrl.split("\n")
                    const urls = res.filter(item => item && item.trim() !== '');
                    for (let k = 0; k < urls.length; k++) {

                        // 正则表达式匹配URL
                        const urlPattern = /^https?:\/\/[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+/;
                        const urlMatch = urls[k].match(urlPattern);
                        const extractedUrl = urlMatch ? urlMatch[0] : null;

                        // 提取数字
                        const numberPattern = /\d+(?=\s*$)/;
                        const numberMatch = urls[k].match(numberPattern);
                        let extractedNumber = 0;
                        if (numberMatch > this.goodRow.maxqty) {
                            extractedNumber = this.goodRow.maxqty;
                        } else if (numberMatch >= this.goodRow.minqty && numberMatch <= this.goodRow.maxqty) {
                            extractedNumber = numberMatch;
                        } else {
                            extractedNumber = this.goodRow.minqty;
                        }

                        //字符串二次拼接
                        finalWebUrl += `${extractedUrl} ${extractedNumber}\n`;

                    }

                    this.finalPay.wbUrl = finalWebUrl

                },
                updateWbUrlByTen(e) {
                    let webUrl = e.target.value;
                    let finalWebUrl = "";

                    const lines = webUrl.split("\n");
                    const validLines = lines.filter(item => item.trim() !== '');

                    for (let line of validLines) {
                        // 使用'----'分割uid和count
                        const parts = line.split('----');
                        if (parts.length !== 2) {
                            console.error('Invalid format:', line);
                            continue;
                        }

                        const [uid, countStr] = parts;

                        // 验证数量是否在范围内
                        let extractedCount = parseInt(countStr, 10);
                        if (isNaN(extractedCount)) {
                            extractedCount = this.goodRow.minqty;
                        } else if (extractedCount > this.goodRow.maxqty) {
                            extractedCount = this.goodRow.maxqty;
                        } else if (extractedCount < this.goodRow.minqty) {
                            extractedCount = this.goodRow.minqty;
                        }

                        // 字符串二次拼接，保留uid和count
                        finalWebUrl += `${uid}----${extractedCount}\n`;
                    }

                    this.finalPay.wbUrl = finalWebUrl.trim(); // 移除末尾的换行符
                    console.log("------------")
                    console.log(this.finalPay.wbUrl)
                },




                getFinalPriceByDifTab() {
                    let activeName = this.activeName
                    let type = "second"
                    let webUrl = this.finalPay.wbUrl
                    let finalCount = 0;
                    //最后修改的微博url

                    //避免type 8 时候出现异常
                    if (this.goodRow.type == 8) {
                        return 0;
                    } if (this.goodRow.type == 10) {
                        let finalCount = 0;
                        if (webUrl !== '') {
                            const lines = webUrl.split("\n");
                            const validLines = lines.filter(item => item.trim() !== '');

                            for (let k = 0; k < validLines.length; k++) {
                                // 分割uid和count
                                const parts = validLines[k].split('----');
                                if (parts.length !== 2) {
                                    console.error('Invalid format:', validLines[k]);
                                    continue;
                                }

                                const [, countStr] = parts;
                                const extractedNumber = parseInt(countStr, 10);

                                // 直接累加，不进行min/max检查
                                finalCount += extractedNumber;
                            }
                            return this.getTimes(this.goodRow.price, finalCount);
                        }
                    } else {
                        if (activeName.toLowerCase() === type.toLowerCase() && webUrl != '') {

                            const res = webUrl.split("\n")
                            const urls = res.filter(item => item && item.trim() !== '');
                            for (let k = 0; k < urls.length; k++) {
                                // 提取数字
                                const numberPattern = /\d+(?=\s*$)/;
                                const numberMatch = urls[k].match(numberPattern);
                                let extractedNumber = 0;
                                if (numberMatch > this.goodRow.maxqty) {
                                    extractedNumber = this.goodRow.maxqty;
                                } else if (numberMatch >= this.goodRow.minqty && numberMatch <= this.goodRow.maxqty) {
                                    extractedNumber = numberMatch;
                                } else {
                                    extractedNumber = this.goodRow.minqty;
                                }
                                // 更新最终价格
                                finalCount = finalCount + Number(extractedNumber);
                            }
                            return this.getTimes(this.goodRow.price, finalCount)
                        }
                    }



                    return this.getTimes(this.goodRow.price, this.finalPay.orderCount);
                },


                handleClick(tab, event) {
                    this.finalPay.orderCount = this.goodRow.minqty;
                    this.finalPay.wbUrl = ''
                    this.finalPay.payPrice = this.getTimes(this.goodRow.price, this.finalPay.orderCount)
                    this.activeName = tab.paneName.toString()
                },

                getTypeByTypeNum(index) {
                    switch (index) {
                        case 1:
                            return "关注"
                            break;
                        case 2:
                            return "转发"
                            break;
                        case 3:
                            return "评论"
                            break;
                        case 4:
                            return "点赞"
                            break;
                        case 5:
                            return "阅读"
                            break;
                        case 6:
                            return "视频播放"
                            break;
                        case 7:
                            return "真人转评赞"
                            break;
                        case 8:
                            return "统一转评赞"
                            break;
                        case 9:
                            return "评中评"
                            break;
                        case 10:
                            return "评论赞"
                            break;
                    }

                },


                // 用户登出
                loginOut() {
                    this.$http.post("/user/logout")
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("登出成功");
                                localStorage.removeItem("token");
                                localStorage.removeItem("loginUser");
                                //展示登录按钮
                                $("#loginBefore").show();
                                $("#loginAfter").hide();
                                location.href = "/index.html";
                            }
                        }).catch(result => {

                        })
                },

                //用户登录
                loginIn() {
                    //参数非空校验
                    if (!this.loginDto.username) {
                        alert("用户民不能为空");
                        return;
                    }
                    if (!this.loginDto.password) {
                        alert("密码不能为空");
                        return;
                    }
                    this.$http.post("/user/login", this.loginDto)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("登录成功，欢迎使用");
                                //将信息存到localStorage
                                localStorage.setItem("token", result.resultObj.token);
                                localStorage.setItem("loginUser", JSON.stringify(result.resultObj.loginUser));
                                //登录后需要展示用户的用户名
                                this.username = result.resultObj.loginUser.username;
                                //展示登出按钮
                                $("#loginBefore").hide();
                                $("#loginAfter").show();
                                //关闭弹框
                                $("#popBox").fadeOut();
                            } else {

                            }
                        }).catch(result => {

                        })
                },

                //创建uuid随机字符串
                createUuid() {
                    var s = [];
                    var hexDigits = "0123456789abcdefghi";
                    for (var i = 0; i < 36; i++) {
                        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
                    }
                    s[14] = "4";
                    s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
                    s[8] = s[13] = s[18] = s[23] = "-";

                    var uuid = s.join("");
                    return uuid;
                },

                //获取图片验证码
                getImg() {
                    let imageCodeKey = sessionStorage.getItem("registerImageCodeKey");
                    if (!imageCodeKey || imageCodeKey === '') {
                        imageCodeKey = this.createUuid(); // 重新生成uuid
                        sessionStorage.setItem("registerImageCodeKey", imageCodeKey);
                    }
                    // 调用后端接口获取图片验证码
                    this.$http.get("/verification/image/" + imageCodeKey)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                this.img = this.imgCodePrefix + result.resultObj;
                            } else {

                            }
                        }).catch(result => {

                        })
                },

                //发送手机验证码
                RegisterDTOCode(event) {
                    //1.判断手机号不为空
                    if (!this.RegisterDTO.phone) {
                        alert("手机号不能为空");
                        return;
                    }
                    //2.判断图片验证码不为空
                    if (!this.RegisterDTO.imageCode) {
                        alert("图片验证码不能为空");
                        return;
                    }

                    //3.获取按钮，禁用按钮
                    var sendBtn = $(event.target);
                    sendBtn.attr("disabled", true);

                    //获取uuid
                    this.RegisterDTO.imageCodeKey = sessionStorage.getItem("registerImageCodeKey");


                    //4.发送ajax请求
                    this.$http.post("/verification/sms/register", this.RegisterDTO)
                        .then(result => {
                            var ajaxResult = result.data;
                            if (ajaxResult.success) {
                                alert("手机验证码已经发送到您的手机，请在1分钟内使用");
                                //4.1.发送成：倒计时
                                var time = 60;

                                var interval = window.setInterval(function () {
                                    //每一条倒计时减一
                                    time = time - 1;

                                    //把倒计时时间搞到按钮上
                                    sendBtn.val(time + "秒后重发");

                                    //4.2.倒计时完成恢复按钮
                                    if (time <= 0) {
                                        sendBtn.val("重新发送");
                                        sendBtn.attr("disabled", false);
                                        //清除定时器
                                        window.clearInterval(interval);
                                    }
                                }, 1000);
                            } else {
                                //4.3.发送失败：提示，恢复按钮
                                sendBtn.attr("disabled", false);
                                alert("发送失败:" + ajaxResult.message);
                            }
                        })
                },

                //注册方法
                registerSave() {
                    //判断手机号不能为空
                    if (!this.RegisterDTO.username) {
                        alert("用户名不能为空");
                        return;
                    }
                    //比较两次密码是否一致
                    if (this.RegisterDTO.password != this.RegisterDTO.confirmPassword) {
                        alert("两次密码不一致，请重新输入");
                        return;
                    }

                    //调用后端注册接口
                    this.$http.post("/user/register", this.RegisterDTO)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("恭喜你,注册成功!");
                                $('#popBox').fadeOut(); // 关闭注册弹框
                            } else {
                                alert(result.message);
                            }
                        })
                },

                // 类型筛选条件
                searchByBrand(type) {

                    this.query.type = type;
                    this.query.currentPage = 1;
                    this.getGoods();
                },

                //价格筛选条件
                searchByPrice(minPrice, maxPrice) {
                    this.query.minPrice = minPrice;
                    this.query.maxPrice = maxPrice;
                    this.query.currentPage = 1;
                    this.getGoods();
                },

                //搜索
                search() {
                    //从第一页开始查
                    this.query.currentPage = 1;
                    this.getGoods();
                },

                //改变页码
                changePageCount(page) {
                    this.query.currentPage = page;
                    this.getGoods();
                },

                // 获取商品
                getGoods() {
                    this.$http.post("/goods/newpage", this.query)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                this.pageInfo = result.resultObj;
                                //计算总页数
                                this.pageInfo.totalPage = Math.ceil(this.pageInfo.total / this.query.pageSize);
                            } else {

                            }
                        }).catch(result => {

                        })
                },

                getuserBalace() {
                    this.$http.get("/user/" + this.userid)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                this.user = result.resultObj;
                                this.balance = this.user.balance;
                                console.log("------------==============")
                                console.log(this.user)
                            } else {

                            }
                        }).catch(result => {

                        })
                },


                // getTimes(firstNum, lastNum) {
                //     return (firstNum * lastNum);
                // },
                getTimes(firstNum, lastNum) {

                    // 将数字转换为字符串
                    const firstNumStr = math.format(firstNum);
                    const lastNumStr = math.format(lastNum);

                    // 使用math.js的bignumber函数将字符串转换为BigNumber
                    const bigFirstNum = String(firstNum).trim().length === 0 ? math.bignumber(0) : math.bignumber(firstNumStr);
                    const bigLastNum = String(lastNum).trim().length === 0 ? math.bignumber(0) : math.bignumber(lastNumStr);

                    // 使用math.js的multiply函数进行精确计算
                    const result = math.multiply(bigFirstNum, bigLastNum).toNumber();

                    return result;

                },


                //点击弹窗
                goodClick(row) {
                    console.log(row)
                    this.goodRow = row;
                    if (this.goodRow.type != 8) {
                        this.goodRow = row;
                        this.showOutOrDialog = true;
                        //初始化金额（默认数量是1，所以默认金额得根据商家的单价定）
                        this.finalPay.orderCount = this.goodRow.minqty;
                        this.finalPay.payPrice = this.getTimes(this.goodRow.price, this.finalPay.orderCount)
                    } else {
                        this.remarks = JSON.parse(row.remarks);
                        this.convertStringsToNumbers(this.remarks)
                        //初始化数量
                        this.uniFinalData.count.countf = this.remarks.sFminqty;
                        this.uniFinalData.count.countc = this.remarks.sCminqty;
                        this.uniFinalData.count.countg = this.remarks.sGminqty;
                        this.showUnitDialog = true;
                        console.log(this.showUnitDialog)
                        this.$nextTick(() => {
                            console.log('After DOM update, showUnitDialog:', this.showUnitDialog);
                            const dialogElement = document.querySelector('.my-dialog-class');
                            console.log('Dialog element:', dialogElement);
                            // 这里可以执行依赖于 DOM 更新的操作
                            // 这里可以执行依赖于 DOM 更新的操作
                        });
                    }
                },

                convertStringsToNumbers(obj) {
                    for (let key in obj) {
                        if (obj.hasOwnProperty(key)) {
                            if (typeof obj[key] === 'string' && !isNaN(obj[key])) {
                                // 如果值是字符串并且可以转换为数字，则进行转换
                                obj[key] = parseFloat(obj[key]);
                            } else if (typeof obj[key] === 'object') {
                                // 如果值是对象，则递归调用自身
                                this.convertStringsToNumbers(obj[key]);
                            }
                        }
                    }
                },


                // 下单校验
                outOrderCheck() {
                    //匹配含空格的url
                    const regex = /(https?:\/\/[^\s\r\n"]*(\s+)?)/g;

                    //不含空格
                    // const regex = /(https?:\/\/[^\s]+)/g;


                    if (this.goodRow.type == 8) {
                        this.showUnitInDialog = true;
                    } else {
                        this.showInOrDialog = true;
                    }

                },


                clickAddUniOrder() {

                    var loginUser = localStorage.getItem("loginUser");
                    if (loginUser) {
                        //设置展开等待遮罩
                        this.fullscreenLoading = true;
                        loginUser = JSON.parse(loginUser);


                        let flprice = {
                            pricef: this.remarks.sFprice,
                            pricec: this.remarks.sCprice,
                            priceg: this.remarks.sGprice
                        };

                        var data = {
                            sId: this.goodRow.id,
                            ShopId: this.goodRow.shopId,
                            uId: loginUser.id,
                            url: this.finalPay.wbUrl,
                            price: JSON.stringify(flprice),
                            count: JSON.stringify(this.uniFinalData.count),
                        };



                        this.$http.post("/order/addorderByunified", data)
                            .then(result => {
                                result = result.data;
                                //设置回收等待遮罩
                                this.fullscreenLoading = false;

                                if (result.success) {
                                    //设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    this.showUnitDialog = false;
                                    this.showUnitInDialog = false;
                                    this.$message({
                                        message: result.message,
                                        type: 'success'
                                    });
                                    this.finalPay.wbUrl = ''
                                } else {

                                    this.$message({
                                        message: result.message,
                                        type: 'warning'
                                    });

                                }
                            }).catch(result => {
                                //设置回收等待遮罩
                                this.fullscreenLoading = false;

                                this.$message({
                                    message: "系统异常",
                                    type: 'warning'
                                });

                            })


                    }

                },

                // 确认下单
                clickAddOrder() {

                    var loginUser = localStorage.getItem("loginUser");
                    if (loginUser) {


                        //设置展开等待遮罩
                        this.fullscreenLoading = true;
                        loginUser = JSON.parse(loginUser);

                        let activeName = this.activeName
                        let type = "second"
                        if (this.goodRow.type == 10) {
                            console.log("second=======================")
                            let webUrl = this.finalPay.wbUrl;

                            const lines = webUrl.split("\n");
                            const validLines = lines.filter(item => item.trim() !== '');

                            let datas = [];
                            let data = {};

                            for (let i = 0; i < validLines.length; i++) {
                                // 分割UID和数量
                                const parts = validLines[i].split('----');
                                if (parts.length !== 2) {
                                    console.error('Invalid format:', validLines[i]);
                                    continue;
                                }

                                const [refundNumberStr, countStr] = parts;
                                const extractedNumber = parseInt(countStr, 10);
                                const refundNumber = parseInt(refundNumberStr, 10);

                                data = {
                                    sId: this.goodRow.id,
                                    ShopId: this.goodRow.shopId,
                                    uId: loginUser.id,
                                    // 注意：类型10中没有URL，所以这里可能需要一个默认值或null
                                    url: null,
                                    finalPrice: this.finalPay.payPrice,
                                    count: extractedNumber,
                                    refundNumber: refundNumber
                                };

                                datas.push(data);
                            }

                            this.username = loginUser.username;
                            this.$http.post("/order/addLotOrder", { orders: datas })
                                .then(result => {
                                    result = result.data;

                                    // 设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    if (result.success) {
                                        this.showInOrDialog = false;
                                        this.showOutOrDialog = false;
                                        this.$message({
                                            message: result.message,
                                            type: 'success'
                                        });
                                        this.finalPay.wbUrl = '';
                                    } else {
                                        this.$message({
                                            message: result.message,
                                            type: 'warning'
                                        });
                                    }
                                }).catch(result => {
                                    // 设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    this.$message({
                                        message: "系统异常",
                                        type: 'warning'
                                    });
                                });
                            return null;
                        }
                        if (activeName.toLowerCase() === type.toLowerCase()) {

                            let webUrl = this.finalPay.wbUrl

                            const res = webUrl.split("\n")
                            const urls = res.filter(item => item && item.trim() !== '');

                            let datas = []
                            let data = {}

                            for (let i = 0; i < urls.length; i++) {

                                // 正则表达式匹配URL
                                const urlPattern = /^https?:\/\/[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+/;
                                const urlMatch = urls[i].match(urlPattern);
                                const extractedUrl = urlMatch ? urlMatch[0] : null;

                                // 提取数字
                                const numberPattern = /\d+(?=\s*$)/;
                                const numberMatch = urls[i].match(numberPattern);
                                let extractedNumber = Number(numberMatch);

                                data = {
                                    sId: this.goodRow.id,
                                    ShopId: this.goodRow.shopId,
                                    uId: loginUser.id,
                                    url: extractedUrl,
                                    finalPrice: this.finalPay.payPrice,
                                    count: extractedNumber,
                                }

                                datas.push(data)

                            }


                            this.username = loginUser.username;
                            this.$http.post("/order/addLotOrder", { orders: datas })
                                .then(result => {
                                    result = result.data;

                                    //设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    if (result.success) {

                                        this.showInOrDialog = false;
                                        this.showOutOrDialog = false;
                                        this.$message({
                                            message: result.message,
                                            type: 'success'
                                        });
                                        // location.reload();
                                        this.finalPay.wbUrl = ''
                                    } else {

                                        this.$message({
                                            message: result.message,
                                            type: 'warning'
                                        });

                                    }
                                }).catch(result => {
                                    //设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    this.$message({
                                        message: "系统异常",
                                        type: 'warning'
                                    });

                                })


                        } else {

                            var data = {
                                sId: this.goodRow.id,
                                ShopId: this.goodRow.shopId,
                                uId: loginUser.id,
                                url: this.finalPay.wbUrl,
                                finalPrice: this.finalPay.payPrice,
                                count: this.finalPay.orderCount,
                                refundNumber: this.goodRow.refundNumber != null ? this.goodRow.refundNumber : ''
                            };


                            this.username = loginUser.username;
                            this.$http.post("/order/addOrder", data)
                                .then(result => {
                                    result = result.data;
                                    //设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    if (result.success) {
                                        //设置回收等待遮罩
                                        this.fullscreenLoading = false;

                                        this.showInOrDialog = false;
                                        this.showOutOrDialog = false;
                                        this.$message({
                                            message: result.message,
                                            type: 'success'
                                        });
                                        // location.reload();
                                        this.finalPay.wbUrl = ''
                                    } else {

                                        this.$message({
                                            message: result.message,
                                            type: 'warning'
                                        });

                                    }
                                }).catch(result => {
                                    console.log(result)
                                    //设置回收等待遮罩
                                    this.fullscreenLoading = false;

                                    this.$message({
                                        message: "系统异常",
                                        type: 'warning'
                                    });

                                })


                        }

                    }

                }


            },

            mounted() {

                // var obj = splitUrl();
                // for (var key in obj) {
                //     this.query[key] = obj[key];
                // }

                this.getGoods();
                // this.getImg();

                //如果localStorage已经有值，此时应该是登录状态
                var loginUser = localStorage.getItem("loginUser");
                if (loginUser) {
                    this.getuserBalace();
                    loginUser = JSON.parse(loginUser);
                    this.username = loginUser.username;
                    this.userid = loginUser.id;
                    //展示登出按钮
                    $("#loginBefore").hide();
                    $("#loginAfter").show();
                }
                this.getuserBalace();

            }

        })


    </script>

    <style>
        body {
            overflow-x: hidden;
        }

        .image {
            width: 100%;
            display: block;
        }

        @media (max-width: 767px) {
            .el-dialog {
                width: 100%;
            }

            .el-col-14 {
                width: 90%;
            }

            .el-col-4 {
                width: 30%;
            }
        }
    </style>


</body>

</html>